{include file="public/header"/}
<script type="text/javascript">
    $(document).ready(function () {
        $(".refreshverify").click(function () {
            $(".yan").attr("src", '?s=User/verify');

        });

        $('form button').click(function () {
            var flag = false;
            $('input[name=username],input[name=password]').each(function () {
                if ($(this).val() == '') {
                    $(this).focus();
                    flag = true;
                    return false;
                }
            });
            if (flag) {
                return false;
            }
            $.post('?s=User/index', $("form").serialize(), function (data) {
                if (data.ret == 1) {
                    window.location.href = data.url;
                } else {
                    alert(data.msg);
                }
            });
        });

        $('input').keypress(function (event) {
            if (event.keyCode == 13) {
                $('form button').click();
            }
        });
    });
</script>
<!-- HTML5 shim and Respond.js IE8 support of HTML5 tooltipss and media queries -->
<!--[if lt IE 9]>
<!--<script src="js/html5shiv.js"></script>
<script src="js/respond.min.js"></script>-->
<![endif]-->

<div class="container">

    <form class="form-signin">
        <h2 class="form-signin-heading">微信后台管理系统</h2>
        <div class="login-wrap">
            <div class="form-group">
                <span class="icon-user"></span>
                <input type="text" name="username" class="form-control login" autocomplete="off" tabindex="1" placeholder="用户名" autofocus>
            </div>
            <div class="form-group">
                <span class="icon-lock"></span>
                <input type="password" name="password" class="form-control login" autocomplete="off" tabindex="2" placeholder="密码">
            </div>
            <div class="form-group">
                <span class="icon-font"></span>
                <input type="text" name="verify" class="form-control login" autocomplete="off" tabindex="2" placeholder="请填写验证码">
                <a class="changezhang refreshverify">换一张？</a>
            </div>
            <img class="yan refreshverify" src="{:url('User/verify')}">
            <button class="btn btn-lg btn-login btn-block" type="button">登录</button>
        </div>
    </form>

</div>
{include file="public/footer"/}